package com.usian.service.impl;

import com.usian.mapper.YuanMapper;
import com.usian.pojo.Yuan;
import com.usian.service.YuanService;
import com.usian.vo.YuanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YuanServiceImpl  implements YuanService {
   @Autowired
   private YuanMapper yuanMapper;
    @Override
    public List<YuanVo> find1() {
        List<YuanVo> yuanVos = yuanMapper.find();
        return yuanVos;
    }

    @Override
    public void add(Yuan yuan) {
        yuanMapper.insert(yuan);
    }

    @Override
    public Yuan findById(Integer id) {
        Yuan yuan = yuanMapper.selectById(id);
        return  yuan;
    }

    @Override
    public void update(Yuan yuan) {
        yuanMapper.updateById(yuan);
    }

    @Override
    public void delete(Integer id) {
            yuanMapper.deleteById(id);
    }
}
